define([
	'backbone',
	'utils/urlUtil',
	'views/viewRouter',
	'views/public/menu',
	'views/public/topUser'
], function(
	Backbone,
	UrlUtil,
	ViewRouter,
	menuView,
	topUserView
) {
	var router = Backbone.Router.extend({
		routes: {
			"": "default",
			"view/:module": "showView",
			"view/:module/:params": "showView"
		},
		default: function() {
			this.navigate("view/welcome", true);
		},
		showView: function(module,params) {
			params = params ? UrlUtil.parse2Obj(params) : '';
			this.renderMenu(module);
			ViewRouter.renderView(module,params);
			//是否要创建TopUser
			if ($('#TOP > .user').html() == '') {
				new topUserView();
			}
		},
		renderMenu: function(module) {
			new menuView({
				module: module,
				router: this
			});
		}
	});
	return router;
})